package fem2.element.crack_sda;

import inf.jlinalg.IMatrix;
import fem2.MaterialModel;
import fem2.MeshPart;
import fem2.material.cohesive_law.CohesiveLaw;

public class SKONConstantJumpTetrahedraElement extends KOSConstantJumpTetrahedraElement {

	public SKONConstantJumpTetrahedraElement(MeshPart mp, MaterialModel mm, CohesiveLaw cl) {
		super(mp, mm, cl);
	}

	@Override
	protected void computeProjectionOperator(MeshPart mp, IMatrix g, double... xi) {
		double coeff = -crackMeasure / elementMeasure;
		g.set(0, 0, coeff * normal[0]);
		g.set(1, 1, coeff * normal[1]);
		g.set(2, 2, coeff * normal[2]);

		g.set(3, 0, coeff * normal[1]);
		g.set(3, 1, coeff * normal[0]);

		g.set(4, 1, coeff * normal[2]);
		g.set(4, 2, coeff * normal[1]);

		g.set(5, 0, coeff * normal[2]);
		g.set(5, 2, coeff * normal[0]);
	}
}
